<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>科室列表</title>
    <!-- 引入CSS和JS文件 -->
</head>
<body>
    <table class="table table-striped">
        <thead>
            <tr>
                <td>科室ID</td>
                <td>科室名称</td>
                <td>主治疾病</td>
                <td>科室设备</td>
                <td>所属医院ID</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            <c:forEach items="${pageInfo.list}" var="department">
            <tr>
                <td>${department.deptid}</td>
                <td>${department.deptname}</td>
                <td>${department.illness}</td>
                <td>${department.equipment}</td>
                <td>${department.hospitalid}</td>
                <td>
                    <a href="findById?deptId=${department.deptid}" class="btn btn-primary">编辑</a>
                    <a href="removeById?deptId=${department.deptid}" class="btn btn-danger" onclick="return confirm('确定要删除该科室吗？')">删除</a>
                </td>
            </tr>
            </c:forEach>
        </tbody>
    </table>
    <form action="find" method="post" class="form-inline">
        <div class="form-group">
            <label for="deptname">科室名称：</label>
            <input type="text" id="deptname" name="deptname" class="form-control" value="${condition.deptname}" placeholder="请输入科室名称">
        </div>
        <div class="form-group">
            <label for="hospitalid">所属医院ID：</label>
            <input type="text" id="hospitalid" name="hospitalid" class="form-control" value="${condition.hospitalid}" placeholder="请输入医院ID">
        </div>
        <button type="submit" class="btn btn-primary">查询</button>
    </form>
</body>
</html>